package ssx.demo.ssxutils.learn2;

import java.util.concurrent.locks.ReentrantLock;

public class Consumer {
    public void del(ReentrantLock reentrantLock){
        reentrantLock.lock();
        if (Main.count == 1){
            Main.count--;
            System.out.println("消费者："+ Main.count);
            reentrantLock.unlock();
        }else {
            reentrantLock.unlock();
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }

    }
}
